The first part : according to the treatment range of the slicing technique in the paper , applying compiling technique , define the grammar of csl language and implement its lexical analysis and syntactical analysis manually , and obtain the ast of the source program of csl 本文在編譯技術(shù)、圖論和程序分片理論的基礎(chǔ)上,探討了程序靜態(tài)分片技術(shù)的實(shí)現(xiàn)策略,介紹了一種整體實(shí)現(xiàn)方案,是關(guān)于結(jié)構(gòu)化語言靜態(tài)程序分片系統(tǒng)實(shí)現(xiàn)的一種嘗試。
First , the paper researches the format and semantic features of iso apt in detail , next , applies regular expression to describe the definition of apt ’ s tokens and uses context - free grammar to describe apt ’ s syntax rules , last , designs the intermediate code format which keeps on the source code semantic and designs a complete module to check lexical and syntax errors of nc code by using modern compiling techniques 在代碼預(yù)處理技術(shù)方面,詳細(xì)研究了標(biāo)準(zhǔn)數(shù)控代碼語言的格式和語義并采用現(xiàn)代編譯技術(shù)中的正則表達(dá)式和上下文無關(guān)文法分別描述了標(biāo)準(zhǔn)數(shù)控代碼語言的記號定義和語法結(jié)構(gòu)定義;設(shè)計(jì)了保持源代碼語義的中間標(biāo)準(zhǔn)數(shù)控代碼格式,在此基礎(chǔ)上,設(shè)計(jì)并構(gòu)建了數(shù)控代碼的詞法和語法檢查模塊。